﻿<%@ Page Language="C#" AutoEventWireup="true" Codebehind="SelectDiaBan.aspx.cs" Inherits="CMS.Web.CompDenu.SelectDiaBan" %>
<script language="javascript" type="text/javascript" src="../Common/util.js"></script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Chọn địa bàn gửi đơn</title>    
    <style type="text/css">
    .divframe {background-color:white;border:1px solid #35B5CE;font-size:12px;
    height:300px;margin:2px;overflow:auto;padding:1px;width:240px;}
    </style>
</head>
<body style="margin:0px" class="">
    <form id="form1" runat="server">
        <div class="divframe">
            <table id="tblThongTinChung" class="Table_Border" style="border-collapse: collapse"
                cellspacing="0" cellpadding="0" width="100%" border="0">
                <tr>
                    <td class="Text_Main">
                        Chọn địa bàn:</td>
                </tr>
                <tr>
                    <td class="Col_Right">
                        <asp:TreeView ID="trvDiaBan" runat="server"
                             ShowLines="true" LineImagesFolder="~/Images/" ExpandDepth="0">                             
                             </asp:TreeView>
                    </td>
                </tr>
                <tr class="Row_Button">
                    <td align="center">
                        <input type="button" id="btnCancel" class="Button" value="Hủy bỏ" onclick="window.close();" />                        
                    </td>
                </tr>
            </table>
            </div>        
    </form>
    <script type="text/javascript">         
        function OnTreeClick(mEvent)
        {
            var src = window.event != window.undefined ? window.event.srcElement : mEvent.target;
            var nodeClick = src.tagName.toLowerCase() == "a";            
            if (nodeClick){
                var nodeText = GetNodeText(src,mEvent);
                var nodeValue = GetNodeValue(src);                 
                SetDiaBan(nodeValue, nodeText);
                src.href="#";
                return false;
            }
                 
        }
        function SetDiaBan(diabanId, dbName){
            if(window.opener){
                parentWindow =  window.opener;
            }else{
                parentWindow = window.dialogArguments;
            }
            var txtDiaBan = parentWindow.document.getElementById("<%=ObjId%>");
            var hidId = parentWindow.document.getElementById("<%=HidId%>");    
            hidId.value = diabanId;
            txtDiaBan.value = dbName;   
            //alert(diabanId);           
            window.close();
        }
    </script>    
</body>
</html>
